home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / k3btrack.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-05-27  |  3.6 KB  |  152 lines

  1. /* 
  2.  *
  3.  * $Id: k3btrack.h 619556 2007-01-03 17:38:12Z trueg $
  4.  * Copyright (C) 2003-2007 Sebastian Trueg <trueg@k3b.org>
  5.  *
  6.  * This file is part of the K3b project.
  7.  * Copyright (C) 1998-2007 Sebastian Trueg <trueg@k3b.org>
  8.  *
  9.  * This program is free software; you can redistribute it and/or modify
  10.  * it under the terms of the GNU General Public License as published by
  11.  * the Free Software Foundation; either version 2 of the License, or
  12.  * (at your option) any later version.
  13.  * See the file "COPYING" for the exact licensing terms.
  14.  */
  15.  
  16.  
  17.  
  18. #ifndef K3BTRACK_H
  19. #define K3BTRACK_H
  20.  
  21. #include <qcstring.h>
  22. #include <qvaluevector.h>
  23.  
  24. #include <k3bmsf.h>
  25. #include "k3bdevice_export.h"
  26.  
  27. namespace K3bDevice
  28. {
  29.   class LIBK3BDEVICE_EXPORT Track
  30.   {
  31.     friend class Device;
  32.  
  33.   public:
  34.     enum TrackType { 
  35.       AUDIO, 
  36.       DATA 
  37.     };
  38.  
  39.     enum DataMode { 
  40.       MODE1, 
  41.       MODE2, 
  42.       XA_FORM1, 
  43.       XA_FORM2, 
  44.       DVD,
  45.       UNKNOWN
  46.     };
  47.  
  48.     Track();
  49.     Track( const Track& );
  50.     Track( const K3b::Msf& firstSector, 
  51.        const K3b::Msf& lastSector, 
  52.        int type, 
  53.        int mode = UNKNOWN );
  54.     Track& operator=( const Track& );
  55.  
  56.     int type() const { return m_type; }
  57.  
  58.     /**
  59.      * Invalid for DVDs and Audio CDs
  60.      */
  61.     int mode() const { return m_mode; }
  62.  
  63.     /**
  64.      * Invalid for DVDs
  65.      */
  66.     bool copyPermitted() const { return m_copyPermitted; }
  67.     void setCopyPermitted( bool b ) { m_copyPermitted = b; }
  68.  
  69.     /**
  70.      * Only valid for audio tracks
  71.      */
  72.     bool preEmphasis() const { return m_preEmphasis; }
  73.     void setPreEmphasis( bool b ) { m_preEmphasis = b; }
  74.  
  75.     bool recordedIncremental() const { return m_preEmphasis; }
  76.     bool recordedUninterrupted() const { return !recordedIncremental(); }
  77.  
  78.     const QCString& isrc() const { return m_isrc; }
  79.     void setIsrc( const QCString& s ) { m_isrc = s; }
  80.  
  81.     const K3b::Msf& firstSector() const { return m_firstSector; }
  82.     const K3b::Msf& lastSector() const { return m_lastSector; }
  83.     void setFirstSector( const K3b::Msf& msf ) { m_firstSector = msf; }
  84.     void setLastSector( const K3b::Msf& msf ) { m_lastSector = msf; }
  85.  
  86.     const K3b::Msf& nextWritableAddress() const { return m_nextWritableAddress; }
  87.     const K3b::Msf& freeBlocks() const { return m_freeBlocks; }
  88.  
  89.     K3b::Msf length() const;
  90.  
  91.     /**
  92.      * This takes index0 into account
  93.      */
  94.     K3b::Msf realAudioLength() const;
  95.  
  96.     /**
  97.      * 0 if unknown
  98.      */
  99.     int session() const { return m_session; }
  100.     void setSession( int s ) { m_session = s; }
  101.  
  102.     /**
  103.      * @return number of indices. This does not include index 0.
  104.      */
  105.     int indexCount() const;
  106.  
  107.     /**
  108.      * Returns the index relative to the track's start.
  109.      * If it is zero there is no index0.
  110.      */
  111.     const K3b::Msf& index0() const { return m_index0; }
  112.  
  113.     /**
  114.      * Set the track's index0 value.
  115.      * @param msf offset relative to track start.
  116.      */
  117.     void setIndex0( const K3b::Msf& msf );
  118.  
  119.     /**
  120.      * All indices. Normally this list is empty as indices are rarely used.
  121.      * Starts with index 2 (since index 1 are all other sectors FIXME)
  122.      */
  123.     const QValueVector<K3b::Msf>& indices() const { return m_indices; }
  124.  
  125.     bool operator==( const Track& ) const;
  126.     bool operator!=( const Track& ) const;
  127.  
  128.   private:
  129.     K3b::Msf m_firstSector;
  130.     K3b::Msf m_lastSector;
  131.     K3b::Msf m_index0;
  132.  
  133.     K3b::Msf m_nextWritableAddress;
  134.     K3b::Msf m_freeBlocks;
  135.  
  136.     int m_type;
  137.     int m_mode;
  138.     bool m_copyPermitted;
  139.     bool m_preEmphasis;
  140.  
  141.     int m_session;
  142.  
  143.     QValueVector<K3b::Msf> m_indices;
  144.  
  145.     QCString m_isrc;
  146.   };
  147. }
  148.  
  149. typedef K3bDevice::Track K3bTrack;
  150.  
  151. #endif
  152.